Code improvement and bug fixes mainly.