more bug fixes and added support for handling values with newlines in standard select format