more work on unit testing and fix bug with long data types