Better handling of relative paths (avoiding exceptions).

Signed-off-by: Natalia Bartol <natalia.b@zend.com>