Changed hadler to handler. Deleted unused vars.
Fixed Warnings #188-D pointless comparison of unsigned integer with zero