Fixed a bug which for some odd reason was not fixed with previous commits