Fixing some Bugs, but still problems with regexp