Merged in changes from ph0rman