Some minor changes, added stdin redirection stub