Fixed issues around empty paths, and relative paths


Thanks @ashimshahi for pointing them out