BATCH-2003: Added some tests and cleanup