Pull request segmented of from #1044

None of my code, just segmenting up @corelanc0d3r 's work so that it gets committed ;)