Bug fixes, better support for very small sources
removed a test function