Errorproofed input, minor changes