Fixes and some improvements