Fixed some issues with assignment vs comparison