Cleaned up engine a bit.