Fixed some bad behaviour