Fixed a issue

@nwinter, could you check if this doesn't mess up with other things?