Bug 856123: fixes multiple issues in selftest-second-stage.py; r=dustin