Fixed wrong range bug.