Fix pregsplit bug, fix namespace capitlization bug