Fixed #534 fixed #532 worked on #530