fix ugly spaghetti code and extend functionality of limiting megas
That conditional actually needed to be where it originally was
Merge pull request #783 from Sulcata/master

Fix spaghetti code?