Fixed some issues with FormMain