Merged from Andrew's master; Ready to send PR