bug fixes for new !last syntax