Closes #11 - fixes undefined offset on inject