Fixed validation errors and added method comments