Fixed a few edgy cases