merge rillian's changes into master

Obviously this is wrong as it should be a merge against a diff of 1.03. Since this is not my fork, I can't fix it. Rillian can you please send a proper pull request?