Issues #150 and #151; add doc and cleanup