Added some missing messages and return values. Also removing some spacings and empty lines.