added bug fixes.