Ported post-2.1.2 changes and improved documentation