Done some bug fixes.