1.0.6 multiple big bug fixes

sorry for this mixed commit