Bugfix Update

This commit addresses two bugs and adds  some functionality.