Added more features and fixed the error messages.