Fix code to handle '0'