Some cleanup and possible fix to prefix not working