Prevent segfault when starting a RAIL remoteApp

My last fix for issue #773 introduced an problem when starting a RAIL remoteApp, resulting in a segfault. This change should overcome that