Minor modifications and bug fixes.