Fixed a few more edge cases