Added new features and made some bug fixes.