New attempt at fixing Lapis. Fixes #740 (hopefully)