Added test for stderr + bugfix