small fixes that should of been caught with tests