Fixed #750 and #776

Or I think I fixed 776... We can check though.