Fixed bugs and added validations/messages.