Handles empty target name more gracefully.

Signed-off-by: Juha Kallioinen <juha.kallioinen@jollamobile.com>