Membership 2 registration - Timeout 504

I'm using Membership 2 on my site and have a sight issue with registration. Login/Registration works fine from /account/ or /memberships/, but has the issue occurs when you first land up in a protected page, click on 'Register' under the form and then after filling up the form, clicking on the 'Free' membership option. The page starts loading and then ends up in a 504 error.
I did a conflict test and it seems like when SmartCrawl is active, the issue occurs.
Any help is appreciated.