Fixed a bug pointed out by a user