Fixed bugs #2240 and #2646, added more text to docs, fixed typos...