Merging cpbotha's changes into primary project, yay!