Record painting tref before Init is called.

Fixes #63.