Fixed wrong comparison <= vs. <