Move some code and fix booleans.