Patch/bugfixup 010115

Some unit tests to demonstrate resolved bugs.