Adding some bug fixes.