Fixes and beautification