General cleanup, also previous commit fixed #1