Fixed a few bugs

minor update fixed a few minor bugs and changed the creation pattern. No New functionality.