Fixed some ifdef issues for MEGA builds