Implemented workarounds for #1432 and #1699.