Unit testing

Unit tests and bug fixes for data types and service operations.