More fault-tolerant canvas code.
Added .foreman with configurable port.