payroll: fixed bugs; added validation