Some Bug fixes.