Corrections and improvements

Complete
fixes: #1, #2, #3, #4