Additional fixes suggested by @jburel