Multiple bug fixes, dryed up code a bit
Merge pull request #75 from pmills88/CirrusFix

Multiple bug fixes, dryed up code a bit