Added a nice bug fix

*Happyface* That was an ugly commit :)