Fix #813 and #814

So sorry for my haste