Bug fixes and prettification