Fixed validation bugs and added max range input