Added check for empty prefix to default to forward slash
Cleaned up formatting