Many small changes/bug fixes.