Bug fixes

Fixed a bunch of bugs, including a crash bug and some timeline issues.