Dynamically adds the last / if needed. Fixed #509