Multiple Enhancements

Fixed a few bugs and added some code for convenience.