Small rewrite to support 'noefi'

This fixes #255