Small changes and bug fixes