Various bug fixes and updates
Second major update.