** Added tests to replicate issue #155
** Fixed issue #155
** Fixed a bug that caused integration tests to fail