fixes const values being GCed before they should be; thanks to @ousado