Some bugfixes
PEG WIP